package moodish.server;

import moodish.comm.ServerComm;
import moodish.comm.ServerSideMessage;

import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;


public class alltest {
	
	@Test
	public void user(){
		
	User usermoodish = new User("UserA");
	assertEquals("UserA", usermoodish.getUser());
	
	usermoodish.setConnected();
	assertTrue(usermoodish.isConnected());
	
	usermoodish.setDisconnect();
	assertFalse(usermoodish.isConnected());
	
	usermoodish.addfriend(usermoodish.getUser());
	assertTrue(usermoodish.inTheListofFriends(usermoodish.getUser()));
	
	usermoodish.removeFriend(usermoodish.getUser());
	assertFalse(usermoodish.inTheListofFriends(usermoodish.getUser()));
	assertTrue(usermoodish.islistOffriendsEmpty());
					
	}
	
	
	@Test 
	public void serverMain(){
		
		ServerComm serverComm = null;
		ServerSideMessage message = serverComm.getNextMessage();
		assertEquals("CLIENT_CONNECTED",message.getType());
		assertEquals("CLIENT_DISCONNECTED",message.getType());
		assertEquals("MOODISH_MESSAGE",message.getType());
		assertEquals("FRIENDSHIP",message.getType());
		assertEquals("UNFRIENDSHIP",message.getType());
		
	}

}
